package com.zhou.JavaAndroidFirm.presenter;

import com.zhou.JavaAndroidFirm.bean.NewsChannelTable;
import com.zhou.JavaAndroidFirm.constract.NewsMainConstract;
import com.zhou.JavaAndroidFirm.rx.RxSubscriber;

import java.util.List;

/**
 * @author Administrator
 * @date 2018/7/15 0015
 * @des
 */
public class NewsMainPresenter extends NewsMainConstract.Presenter {

    @Override
    public void lodeMineChannelsRequest() {
        addSubscribe(mModel.lodeMineNewsChannels().subscribe(new RxSubscriber<List<NewsChannelTable>>(mContext, false) {
            @Override
            protected void _onNext(List<NewsChannelTable> newsChannelTables) {
                mView.returnMineNewsChannels(newsChannelTables);
            }

            @Override
            protected void _onError(String message) {
                mView.showTip(message);
            }
        }));
    }
}
